#ifndef __MISC_INI_HPP__
# define __MISC_INI_HPP__

# include <string>
# include <map>
# include <vector>
# include <istream>

# include <boost/property_tree/ptree.hpp>
# include <boost/property_tree/xml_parser.hpp>

/**
 * @brief Tool to parse xml configuration file.
 */
struct config_t
{
    typedef boost::property_tree::ptree opt_t;

    config_t(const std::string& filename)
    {
        using namespace boost::property_tree;
        boost::property_tree::read_xml(filename, tree, xml_parser::no_comments | xml_parser::trim_whitespace);
    }

    config_t(std::istream& stream)
    {
        using namespace boost::property_tree;
        boost::property_tree::read_xml(stream, tree, xml_parser::no_comments | xml_parser::trim_whitespace);
    }

    opt_t tree;
};
#endif //__MISC_INI_HPP__
